const { isProd } = require('./src/utils/is');
module.exports = {
  presets: [
    [
      '@babel/preset-env',
      {
        useBuiltIns: 'usage',
        corejs: 3.2,
      },
    ],
    '@babel/preset-react',
    // https://babeljs.io/docs/babel-preset-typescript
    '@babel/preset-typescript', //如使用ts需添加
  ],
  plugins: [
    !isProd() && require.resolve('react-refresh/babel'),
  ].filter(Boolean),
};
